Framerate
Framerate is the rate at which images are displayed. It is often given as frames per second or refresh rate. Ideal value In the gamedev forums, chatrooms, and many other places, it is common to hear people say that either 60 or 50 FPS is the ideal, and watch them blindly hardcode their way into a less than ideal situation. It is ideal to display a single unique image during each screen refresh. If this is not possible, it is best to display the same image at a regular interval of refreshes. For example, each image could remain on screen for two refreshes, or for three refreshes, or some other multiple. It is important that the rate be consistent to provide the best viewing experience. Screen refresh rate CRTs use a beam to scan horizontal rows along the screen from top to bottom, and then perform a large jump from bottom to top. There is a very brief update time as the beam jumped back along the row (horizontal blank interval, or hblank) and a much longer time as the beam jumped between bottom to top (vertical blank interval or vblank). The NTSC television standard (used in North America, Central America, and most of Asia and South America) specifies a horizontal frequency of 15.734 kHz and a vertical frequency of 60 Hz. The PAL and SECAM standards use a horizontal frequency of 15.625 kHz and a vertical frequency of 50 Hz. Thus, for standard television sets, we can see where the 50 Hz and 60 Hz ideal rates come from. The different frequency rates used by both VGA and DVI continue to include hblank and vblank intervals to accommodate old hardware, although new display devices need much less time (or in some cases, no extra time) to blank. Because the computer hardware requires a short time to replace the displayed images (buffer swapping), it is ideal to perform the copy during blanking intervals. Swapping pixels while a scan line was being displayed results in visual corruption on that scan line. The display data must be replaced during either vertical blank or horizontal blank in order to prevent this corruption. (Newer video cards enforce this requirement, but historically this was a common cause of visual artifacts.) Replacing the image during a horizontal blank interval in the middle of display results in sheared images, where the top half of the display is at time x and the bottom half is at time x+1. For many people this is visually disturbing, and should be avoided. Therefore, the ideal time to replace the image is during the vertical blank interval. Computer monitors are able to use a wide range of display frequencies, with vertical refresh rates ranging from below 30 Hz to over 250 Hz. Showing your frame rate It has (unfortunately) become common practice to only express display quality in terms of frames per second. A much more useful set of numbers are the minimum, average, and maximum display time over each second. Consider these scenarios. We'll assume a 75 Hz refresh rate monitor, so that's our ideal frame rate. The min/avg/max are given in milliseconds. FPS: 75 min/avg/max: 0 / 13 / 999 Sure it is 75 frames per second. But it is really really bad. This is the extreme example. Even though it gets 75 frames per second, 74 frames take almost zero time and one frame consumes the remainder of the second. That's essentially a slide show of one new image per second. Seeing a slide show while looking only at the average FPS will result in confusion. FPS: 75 min/avg/max: 7 / 13 / 49 This is also 75 frames per second, but it reveals useful information about the program. The worst frame is running at 49 milliseconds, or roughly 20 Hz. The fastest frame is at 7 ms or 150 Hz. This shows that the work needs to be balanced out between frames, but is good on average, and even the worst case is probably acceptable. FPS: 75 min/avg/max: 13 / 13 / 14 Again we're at 75 frames per second, and it is very good. With this one you know that you are taking almost exactly the same amount of time for every frame, consistently. It's a solid frame rate. Additional frame information Often it is important to display the computation time per frame. This will help expose a wide range of flaws or potential issues within your software. Therefore it is often useful to show processing time per frame in the same min/avg/max display next to rendering rate.